#pragma once

#include <string>
#include <vector>
#include <QMetaType>

namespace kryptos { namespace entities {

class KeyInfo
{
public:

    enum KeyType
    {
        RSA
    };

    KeyInfo(){}
    KeyInfo(const KeyInfo& keyinfo);
    KeyInfo(KeyType type,
            std::string name,
            std::string email,
            std::string comment,
            std::string passphrase,
            int size
            );

    KeyInfo(KeyType type,
            std::string keyid,
            std::string name,
            std::string email,
            std::string comment,
            std::string passphrase,
            std::string timestamp,
            int size
            );

    virtual ~KeyInfo();

    // setters
    void setKeyid     (std::string keyid);
    void setPassphrase(std::string passphrase);
    void setTimestamp (std::string timestamp);
    void setIsIdentity(bool val);

    // getters
    std::string keyid     () const;
    std::string name      () const;
    std::string email     () const;
    std::string comment   () const;
    std::string passphrase() const;

    bool        isIdentity() const;
    int         size() const;
    KeyType     type() const;

protected:

    std::string m_keyid;
    std::string m_name;
    std::string m_email;
    std::string m_comment;
    std::string m_passphrase;
    std::string m_timestamp;
    KeyType     m_type;
    int         m_size;
    bool        m_isIdentity;
};

typedef std::vector<KeyInfo> KeyInfoList;

}}

Q_DECLARE_METATYPE(kryptos::entities::KeyInfo)
Q_DECLARE_METATYPE(kryptos::entities::KeyInfoList)
